Other Extensions

The following extensions are available globally.

  • Declaration

    Swift

    public extension Sequence where Iterator.Element: Hashable
  • Default implementation LaunchEnvironmentValue for string. Usage example:

    public struct StringLaunchEnvironment: LaunchEnvironmentProtocol {
    
        public typealias Value = String
        public let value: Value
        public var launchEnvironments: [String : String]? {
            return [uniqueIdentifier: value]
        }
        public init(value: Value) {
            self.value = value
        }
    }
    

    Note

    internal initializer would be generated automatically but it would not fulfill requirement of public protocol.
    See more

    Declaration

    Swift

    extension String: LaunchEnvironmentValue
  • Provides default implementation for any RawRepresentable type to represent a launch environment in a few simple steps.

    Example:

    enum LimitedOptionsEnvironment: String, LaunchEnvironmentWithSingleValue {
        case one
        case two
    
        var key: String {
            return "LimitedOptionsEnvironment"
        }
    }
    

    Usage:

    let app = XCUIApplication()
    TestLauncher(options: [
        LimitedOptionsEnvironment.one
    ]).configure(app).launch()
    
    See more

    Declaration

    Swift

    public extension RawRepresentable where Self: LaunchEnvironmentWithSingleValue